package myzzyl.controller.customer;


import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import myzzyl.domain.dto.MemberLoginDto;
import myzzyl.domain.vo.MemberLoginVo;
import myzzyl.response.BaseResponse;
import myzzyl.service.MemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/customer")
@Slf4j
@Tag(name = "小程序端用户相关")
public class MemberController {


    @Autowired
    private MemberService memberService;


    /**
     * 小程序端用户wx登录
     */
    @PostMapping("/user/login")
    public BaseResponse<MemberLoginVo> wxLogin(@RequestBody MemberLoginDto memberLoginDto) {
        log.info("小程序端wx用户登录：{}", memberLoginDto);
        return BaseResponse.success(memberService.wxLogin(memberLoginDto));
    }


}
